{% extends "question/base.html" %}
{% block title %}Question detail{% endblock %}
{% block style %}
{% endblock %}	  

{% block content %}
<p><a href="/question/list/"><b>list</b></a></p>
<h3>Question Detail</h3>

<p><img src="{{ question.image.get_url}}" width="500"></p>
<p>user: <a href="/people/{{ question.user.pk}}/">{{ question.user.username }}</a></p>
<p>分类: {{ question.category.name }}
<p>提问:{{ question.content }}</p>
<a href="/report/question.question/{{ question.pk }}/">report</a>

<h3>Vote Result</h3>
<p>Vote Count: {{ question.votestat.vote_count}}</p>
<p>Agree: {{ question.votestat.agree_num}}</p>
<p>Disagree: {{ question.votestat.disagree_num}}</p>

{% for vote in votes%}
	<p><a href="/people/{{ vote.user.pk}}/">{{vote.user.username}}</a>: {{ vote.result}}</p>
	{% if vote.has_opinion %}
	<p>Opinion: {{ vote.opinion }}</p>
	<p>is_star: {{ vote.is_star }}</p>
	{% if question.is_mine %}
		<a href="/conversation/{{vote.pk}}/">Reply</a>&nbsp;&nbsp;
	{% endif %}
	<a href="/report/vote.vote/{{ vote.pk }}/">report</a>&nbsp;&nbsp;
		{% if not vote.is_star and question.is_mine %}
		<a href="/star/add/{{ vote.pk }}/">star</a>
		{% endif%}
	{% endif%}
	<p>---------------------------------------------------------------</p>
{% endfor %}

<h3>Vote</h3>
<form action="/vote/{{ question.pk }}/" method="post">{# {% csrf_token %} #}
{{ form.as_p }}
<input type="submit" value="Vote" />
</form>


{% endblock %}